//
//  WNModel.h
//  Whatnet_iOS
//
//  Created by Bill on 2019/4/16.
//  Copyright © 2019 什么网络. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@protocol WNModelCoding <NSCoding>
/**
 如果需要归档，子类需要实现这个协议就行了，不用写- (instancetype)initWithCoder:(NSCoder *)aDecoder
 和- (void)encodeWithCoder:(NSCoder *)aCoder，如果需要自定义归档，则需要重写这两个方法
 
 @return keys 。。model的那些属性需要存储就写在这个数组里面
 */
- (NSArray<NSString *>*)codingKeys;

@end

@interface WNModel : NSObject <NSCoding>

- (instancetype)initWithDict:(NSDictionary *)dict;
+ (instancetype)modelWithDict:(NSDictionary *)dict;
- (instancetype)initWithArray:(NSArray *)array;

- (NSDictionary *)dictionary;
- (BOOL)checkComplete;
@end


@interface WNModelHelp : NSObject <NSCoding>

+ (NSMutableArray *)helpWithDefault;

+ (NSString *)titleWithSection:(NSInteger)section;
+ (NSString *)titleWithIndexPath:(NSIndexPath *)indexPath;

- (instancetype)initWithDict:(NSDictionary *)dict;
+ (instancetype)modelWithDict:(NSDictionary *)dict;

@end

NS_ASSUME_NONNULL_END
